__author__ = 'Lenka'

from selenium.webdriver.common.by import By

from php4dvd.pages.page import Page


class LoginPage(Page):
    """
    This is description of the login-page.
    """
    @property
    def username_field(self):
        return self.driver.find_element(By.XPATH, ".//input[@name='username']")

    @property
    def password_field(self):
        return self.driver.find_element(By.XPATH, ".//input[@name='password']")

    @property
    def submit_button(self):
        return self.driver.find_element(By.XPATH, ".//input[@name='submit']")

    @property
    def is_this_page(self):
        return self.is_element_visible((By.CSS_SELECTOR, "#loginform"))

